#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author  : YuLei Lan
# @Software: PyCharm

from django.urls import path
from . import views

urlpatterns = [
    path("", views.UserInfoViewSet.as_view({"get": "list", "post": "create"})),
    path("role-list", views.GetUserRoleViews.as_view()),
    path("details", views.UserDetailsViews.as_view()),
    path("<int:pk>", views.UserInfoViewSet.as_view({"get": "retrieve", "put": "update", "delete": "destroy"})),

    path("role", views.RolesViewSet.as_view({"get": "list", "post": "create"})),
    path("role/<int:pk>", views.RolesViewSet.as_view({"get": "retrieve", "put": "update", "delete": "destroy"})),
    path("role/menu", views.RoleMenuListViews.as_view()),

    path("menu", views.MenusViewSet.as_view({"get": "list", "post": "create"})),
    path("menu/<int:pk>", views.MenusViewSet.as_view({"get": "retrieve", "put": "update", "delete": "destroy"})),
    path("menu/tree", views.MenuTreeViews.as_view()),
    path("menu/list", views.MenuListViews.as_view()),
    path("menu/role", views.RolePermViews.as_view()),

    path("perm", views.GetUserPermissions.as_view())
]
